package bb.lanxing.device.sgdevcie.xpair.uimodel;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;

public final class FailedRemoveBondDevices implements Serializable {
    private List<RemoveFailedDevices> devices;

    public FailedRemoveBondDevices() {
        this(null, 1, null);
    }

    public static FailedRemoveBondDevices copy$default(FailedRemoveBondDevices failedRemoveBondDevices, List list, int i, Object obj) {
        if ((i & 1) != 0) {
            list = failedRemoveBondDevices.devices;
        }
        return failedRemoveBondDevices.copy(list);
    }

    public final List<RemoveFailedDevices> component1() {
        return this.devices;
    }

    public final FailedRemoveBondDevices copy(List<RemoveFailedDevices> devices) {
        Intrinsics.checkNotNullParameter(devices, "devices");
        return new FailedRemoveBondDevices(devices);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        return (obj instanceof FailedRemoveBondDevices) && Intrinsics.areEqual(this.devices, ((FailedRemoveBondDevices) obj).devices);
    }

    public int hashCode() {
        return this.devices.hashCode();
    }

    public String toString() {
        return "FailedRemoveBondDevices(devices=" + this.devices + ')';
    }

    public FailedRemoveBondDevices(List<RemoveFailedDevices> devices) {
        Intrinsics.checkNotNullParameter(devices, "devices");
        this.devices = devices;
    }

    public FailedRemoveBondDevices(ArrayList arrayList, int i, DefaultConstructorMarker defaultConstructorMarker) {
        this((i & 1) != 0 ? new ArrayList() : arrayList);
    }

    public final List<RemoveFailedDevices> getDevices() {
        return this.devices;
    }

    public final void setDevices(List<RemoveFailedDevices> list) {
        Intrinsics.checkNotNullParameter(list, "<set-?>");
        this.devices = list;
    }

    public final void addOne(String address) {
        Intrinsics.checkNotNullParameter(address, "address");
        this.devices.add(new RemoveFailedDevices(address));
    }

    public final void removeOne(String address) {
        Object obj;
        Intrinsics.checkNotNullParameter(address, "address");
        Iterator<RemoveFailedDevices> it = this.devices.iterator();
        while (true) {
            if (!it.hasNext()) {
                obj = null;
                break;
            }
            obj = it.next();
            if (Intrinsics.areEqual(((RemoveFailedDevices) obj).getAddress(), address)) {
                break;
            }
        }
        RemoveFailedDevices removeFailedDevices = (RemoveFailedDevices) obj;
        if (removeFailedDevices != null) {
            this.devices.remove(removeFailedDevices);
        }
    }
}
